package com.basic.business.img.domain;

import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.HeadFontStyle;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import com.basic.common.core.domain.BaseEntity;
import com.basic.common.utils.easyExcel.ExcelImgUrlConverter;
import lombok.Getter;
import lombok.Setter;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import com.basic.common.utils.StringUtils;
import com.basic.common.utils.uuid.ULID;

/**
 * 业务-素材信息对象 t_images_info
 * 
 * @author zhaoxy_jn@163.com
 */
@Getter
@Setter
@ExcelIgnoreUnannotated
@ColumnWidth(16)
@HeadRowHeight(14)
@HeadFontStyle(fontHeightInPoints = 11)
public class TImagesInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 图片编码 */
    @ExcelProperty(value = "素材编码")
    private String id;

    /** 图片名称 */
    @ExcelProperty(value = "图片名称")
    private String imgName;

    /** 图片类别 */
    private String imgCategory;

    /** Minio桶地址 */
    private String bucketUrl;

    /** 源图片路径 */
    private String imgSourcePath;

    /** jpg图片路径 */
    private String imgJpgPath;

    /** png图片路径 */
    private String imgPngPath;

    /** 源图片类型 1PSD 2TIF 3TIFF 4CDR 5AI */
    private String imgType;

    /** 源图片hash值 */
    private String imgHash;

    /** 源图片大小（KB） */
    private Long imgSourceSize;

    /** jpg图片大小（KB） */
    private Long imgJpgSize;

    /** png图片大小（KB） */
    private Long imgPngSize;

    /** png图片完整路径 */
    @ExcelProperty(value = "缩略图", converter = ExcelImgUrlConverter.class)
    private String imgFullPngUrl;

    /** 状态 正常：NORMAL 删除：DELETED 锁定：LOCKED */
    private String imgStatus;

    /** 特征码状态 成功：SUCCESS 失败：FAIL */
    private String imgVectorsStatus;

    private String flag;

    public String getImgFullPngUrl() {
        return bucketUrl + imgPngPath;
    }

    public void setId(String id) {
        this.id = StringUtils.isNotEmpty(id) ? id : ULID.getId();
    }
}
